﻿using Microsoft.AspNetCore.Mvc;
using TR.AppService.AppService.WHOM_Selected;
using TR.AppService.AppService.WHOM_suppy;
using TR.AppService.Dto.WHOMDto;
using TR.AppService.Dto;
using TR.Domain.Entity.WHOB;
using TR.Domain.Entity.WH_return_;
using TR.Domain.Entity;
using TR.EFCore.Repository.WHOM_return_suppyEFcode;

namespace TR.WebApi.Controllers.WHOM_suppy_h
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class whom_suppy_hController : ControllerBase
    {
        private AppService.AppService.WHOM_suppy.wh_return_suppy_h Iws;

        public whom_suppy_hController(AppService.AppService.WHOM_suppy.wh_return_suppy_h Iws)
        {
            this.Iws = Iws;
        }
        //分页条件查询
        [HttpGet]
        public async Task<DtoFenYe<TR.Domain.Entity.WH_return_.wh_return_suppy_h>> WHOMWhereSelectAsync(int mys, int dqy, string? qsj, string? hsj)
        {
            return await Iws.WHOB_FenYeSelect(mys, dqy, qsj, hsj);
        }
        [HttpGet]
        public async Task<List<wh_orderbuy_d>> regret(string buy_code) 
        {
            return await Iws.Regret(buy_code);
        }
        [HttpPost]
        public async Task<bool> addwhom_h([FromBody] TR.Domain.Entity.WH_return_.wh_return_suppy_h wh_Return_Suppy_H)
        {
            return await Iws.addwhom_h(wh_Return_Suppy_H);
        }
        [HttpGet]
        //新增退货明细
        public async Task<bool> addshom_d([FromQuery] wh_return_suppy_d wh_Return_Suppy_D)
        {
            return await Iws.addwhom_d(wh_Return_Suppy_D);
        }
    }
}
